package com.hdw.controller;

import com.hdw.hello.SayHiService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("hello")
public class Hello {

    @Reference(interfaceName = "SayHiService")
    private SayHiService sayHiService;

    @RequestMapping("v1")
    public String sayHi(String hi) {
        try {
            return sayHiService.sayHi(hi);
        } catch (Exception e) {
            return "哈哈：异常" + e.getMessage();
        }

    }
}
